#ifndef _SAI_GUI_VIEW_H_
#define _SAI_GUI_VIEW_H_
#include "../sgame.h"


//dragview.c
typedef void (*sDragClick)(sObj*obj,int act);
//创建拖拽
extern sObj*sGuiNewDragView(int x,int y,sSpr*spr,sDragClick click,int move);
//监控拖拽
extern void sGuiDragEve(void*ob,int type,int p1,int p2);

//seekbar.c
//绘制拖拽盘
extern void sGuiDrawDragPad(void*ob);
//创建拖拽条
extern sObj*sGuiNewSeekBar(int x,int y,int w,int h,int max,int dw,sDragClick click);
//获取控制钮
extern sObj*sGuiGetSeekDrag(sObj*obj);
//创建进度条
extern sObj*sGuiNewSeekView(int x,int y,int w,int h,int max);
//绘制进度
extern void sGuiDrawSeekBar(void*ob);
//设置进度
extern void sGuiSetSeekBar(sObj*obj,int load);
//获取进度
extern int sGuiGetSeekBar(sObj*obj);

//button.c
//按钮回调
typedef void (*sBtnClick)(sObj*obj,int act);
//创建按钮
extern sObj* sGuiNewBtn(int x,int y,sSpr*spr,sBtnClick click);
//长按事件
extern void sGuiBtnLong(sObj*obj,sBtnClick click,int time);
//监控按钮
extern void sGuiBtnEve(void*ob,int type,int p1,int p2);
//绘制V9按钮
extern void sGuiDrawBtnV9(sObj*obj,int x,int y,int rw,int rh,int dw,int dh);

//textview.c
//绘制文字
extern void sGuiDrawText(void*ob);
//创建文本
extern sObj* sGuiNewText(int x,int y,char*text,_FNT*fnt);
//设置文本
extern int sGuiSetText(sObj*obj,char*text);
//绘制文本
extern void sGuiDrawTextPos(sObj*obj,sCam*cam,int dx,int dy);


//edittext.c
//输入框回调
typedef void (*sEditClick)(sObj*obj,int act);
//对话框回调
extern void sGuiEditClick(sObj*obj,int act);
//创建输入框
extern sObj* sGuiNewEdit(sSpr*spr,char*title,char*text,_FNT*fnt,int type,int max,sEditClick click);
//监控输入框
extern void sGuiEditEve(void*ob,int type,int p1,int p2);

#endif
